Most computers today support binary floating-point in hardware. While suitable for many scientific applications, binary floating-point arithmetic is inadequate for financial, commercial, and user-centric applications or web services because the decimal data used in these applications cannot be represented exactly using binary floating-point. The problems of binary floating-point can be avoided by using base 10 (decimal) exponents and preserving those exponents where possible. The Decimal Arithmetic Specification defines a general purpose floating-point decimal arithmetic, which allows fixed-point and integer decimal arithmetic as a subset. These decimal floating-point (DFP) encodings are proposed by the IEEE 754r committee and currently included in the proposed IEEE-SA 754r standard, are:                A decimal32 number, which is encoded in four consecutive bytes (32 bits);        A decimal64 number, which is encoded in eight consecutive bytes (64 bits); and        A decimal128 number, which is encoded in 16 consecutive bytes (128 bits).        
To compare two values, the above encodings require decoding the two values into general decimal representations before comparing, and thus are not efficient for value comparison purposes. Value comparison is used extensively in database systems for features such as sorting.
Accordingly, there exists a need for a floating-point decimal encoding scheme which preserves the ordering of the underlying values, and thus allow for value comparison of two values without requiring the decoding of the two values into general decimal representations. The present invention addresses such a need.